#!/bin/bash
SCRIPT_BASE_DIR=$( dirname "${BASH_SOURCE[0]}" )
source "${SCRIPT_BASE_DIR}/common/fs_utils.sh"

function usage() {
    echo "Usage: $( basename $0 ) <video> <audio> <output>"
    echo "     用ffmpeg合并视频和语音文件到一个文件中"
    exit 1
}

if [ $# -ne 3 ]
then
    usage
fi

vfile=$1
afile=$2
ofile=$3

file_exists_or_die "${vfile}"
file_exists_or_die "${afile}"

# 自动选择vcodec, acodec
ffmpeg -i "${vfile}" -i "${afile}" "${ofile}"
